/**
 * Created by webhugo on 11/25/16.
 */

let request = require('superagent');
const config = require('../../config/config');

var addComment = () => {
    request
        .post(`http://localhost:${config.server.port}/course/addComment/1`)
        .send({
            "type":1,
            "text":"haha"
        })
        .end((e, res) => {
            // console.log(res);
            // console.log(e);
        })
};
var delComment = () => {
    request
        .post(`http://localhost:${config.server.port}/course/delComment/101`)
        .end((e, res) => {
            console.log(res);
            // console.log(e);
        })
};
var login = () => {
    request.post(`http://localhost:${config.server.port}/user/login`)
        .send({username:'name1',password:'123'})
        .end((err,res)=> {
            console.log(err);
            follow();
        })
};
var like = () => {
    request.post(`http://localhost:${config.server.port}/course/like/1`)
        .end((err,res)=> {
            console.log(err);
        })
};
var follow = () => {
    request.post(`http://localhost:${config.server.port}/course/follow/1`)
        .end((err,res)=> {
            console.log(err);
        })
};
// addComment();
// delComment();
login();